package cn.fuxue.hrms.common.entity;
import java.sql.Timestamp;
/**
 * @author 王文勇
 * @version 1.0
 * 工作流节点实体类
 */

public class WorkflowNode {
    // 主键
    private int id;
    // 所属模板 ID，外键关联 workflow_template 表的 id
    private int templateId;
    // 节点类型，取值为 start（开始）、approval（审批）、end（结束）
    private NodeType nodeType;
    // 节点名称
    private String nodeName;
    // 下一个节点 ID，外键关联 workflow_node 表的 id
    private Integer nextNodeId;
    // 节点配置信息
    private String config;
    // 起始节点 ID，外键关联 workflow_node 表的 id
    private Integer startNodeId;
    // 最后修改人 ID
    private Integer modifyId;
    // 创建人 ID
    private Integer createId;
    // 是否删除，1 表示已删除，0 表示未删除
    private boolean isDeleted;
    // 创建时间
    private Timestamp createTime;

    // 无参构造函数
    public WorkflowNode() {
    }

    // 全参构造函数
    public WorkflowNode(int id, int templateId, NodeType nodeType, String nodeName,
                        Integer nextNodeId, String config, Integer startNodeId,
                        Integer modifyId, Integer createId, boolean isDeleted,
                        Timestamp createTime) {
        this.id = id;
        this.templateId = templateId;
        this.nodeType = nodeType;
        this.nodeName = nodeName;
        this.nextNodeId = nextNodeId;
        this.config = config;
        this.startNodeId = startNodeId;
        this.modifyId = modifyId;
        this.createId = createId;
        this.isDeleted = isDeleted;
        this.createTime = createTime;
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTemplateId() {
        return templateId;
    }

    public void setTemplateId(int templateId) {
        this.templateId = templateId;
    }

    public NodeType getNodeType() {
        return nodeType;
    }

    public void setNodeType(NodeType nodeType) {
        this.nodeType = nodeType;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public Integer getNextNodeId() {
        return nextNodeId;
    }

    public void setNextNodeId(Integer nextNodeId) {
        this.nextNodeId = nextNodeId;
    }

    public String getConfig() {
        return config;
    }

    public void setConfig(String config) {
        this.config = config;
    }

    public Integer getStartNodeId() {
        return startNodeId;
    }

    public void setStartNodeId(Integer startNodeId) {
        this.startNodeId = startNodeId;
    }

    public Integer getModifyId() {
        return modifyId;
    }

    public void setModifyId(Integer modifyId) {
        this.modifyId = modifyId;
    }

    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    public boolean isDeleted() {
        return isDeleted;
    }

    public void setDeleted(boolean deleted) {
        isDeleted = deleted;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    // 节点类型枚举
    public enum NodeType {
        START, APPROVAL, END
    }

    @Override
    public String toString() {
        return "WorkflowNode{" +
                "id=" + id +
                ", templateId=" + templateId +
                ", nodeType=" + nodeType +
                ", nodeName='" + nodeName + '\'' +
                ", nextNodeId=" + nextNodeId +
                ", config='" + config + '\'' +
                ", startNodeId=" + startNodeId +
                ", modifyId=" + modifyId +
                ", createId=" + createId +
                ", isDeleted=" + isDeleted +
                ", createTime=" + createTime +
                '}';
    }
}
